home *** CD-ROM | disk | FTP | other *** search
- #include <extras/packdata.h>
-
- /****** extras.lib/PD_PackData ******************************************
- *
- * NAME
- * PD_PackData -- Pack supplied data into a memory block.
- *
- * SYNOPSIS
- * packeddata = PD_PackData(Tags)
- *
- * struct PackedData *PD_PackData(Tag Tags, ... )
- *
- * FUNCTION
- * Packs supplied data into a memory block, suitable for writing
- * to disk.
- *
- * INPUTS
- * Tags - a TagList.
- * PD_Version - Adds a ULONG into the memory block.
- * Sets the version of the data.
- *
- * PD_BYTE - Adds a BYTE into the memory block.
- * PD_UBYTE - Adds a UBYTE into the memory block.
- *
- * PD_WORD - Adds a WORD into the memory block.
- * PD_UWORD - Adds a UWORD into the memory block.
- *
- * PD_LONG - Adds a LONG into the memory block.
- * PD_ULONG - Adds a ULONG into the memory block.
- *
- * PD_STRPTR - Adds a NULL terminated string into the memory block.
- * NULL pointers are supported
- *
- * PD_APTRSize - Adds the ULONG into the memory block,
- * Sets size for subsequent PD_APTRs.
- * PD_APTR - Adds data into the memory block. Size
- * of data is set by previous PD_APTRSize.
- * if NULL, PD_APtrSize bytes are still written but are
- * unset.
- *
- * PD_BufferSize - Set the size of subsequent PD_Buffers
- * This tag does not add data to buffer.
- *
- * PD_Buffer - Adds size of buffer, ULONG, followed by
- * data pointed to by ti_Data.
- * See note for PD_UnpackData(()
- *
- * PD_MemoryFlags - Sets MemoryFlags for allocating
- *
- *
- * RESULT
- *
- * EXAMPLE
- *
- * NOTES
- * Except for BYTEs, data is UWORD aligned, pads are inserted as needed.
- *
- * PackedData->pd_Data
- * {
- * ULONG privatelength
- * {private bytes}
- * user data
- * }
- *
- *
- * BUGS
- *
- * SEE ALSO
- *
- ******************************************************************************
- *
- */
-
- /****** extras.lib/PD_UnpackData ******************************************
- *
- * NAME
- * PD_UnpackData -- Unpack memory block.
- *
- * SYNOPSIS
- * success = PD_UnpackData(Tags)
- *
- * BOOL *PD_UnpackData(Tag Tags, ... )
- *
- * FUNCTION
- * Packs supplied data into a memory block, suitable for writing
- * to disk.
- *
- * INPUTS
- * Tags - a TagList.
- * For most tags, ti_Data is a storage pointer, if NULL the
- * data is parsed but not stored.
- *
- * PD_Version - (ULONG *) Reads the version of the data.
- *
- * PD_IfVersion - (ULONG) Once PD_Version has been read, you can
- * this tag to stop data processing if PD_Version is lower than
- * the value of this tag.
- *
- * PD_BYTE - (BYTE *) Read a BYTE
- * PD_UBYTE -(UBYTE *)
- *
- * PD_WORD - (WORD *) Read a WORD
- * PD_UWORD -(UWORD *)
- *
- * PD_LONG - (LONG *) Read a LONG
- * PD_ULONG -(LONG *)
- *
- * PD_STRPTR - (STRPTR *) AllocVec()s Memory for new STRPTR
- * if PD_FreeSTRPTR is set, existing STRPTR is FreeVec()ed.
- *
- * PD_APTRSize - (ULONG *) Reads the amount of bytes that subsequent
- * PD_APTRs read from the packed data.
- *
- * PD_APTR - Reads data from the memory block. Size
- * of data is set by previous PD_APTRSize.
- * if NULL, PD_APtrSize bytes are still written but are
- * unset.
- *
- * PD_BufferSize - (ULONG) Set data size for subsequent PD_Struct
- * reads. This tag does not read any data, you must specify
- * the size of your Buffer.
- *
- * PD_Buffer - (APTR) Data is copied to existing memory, the amount
- * of data copied will be the lesser of PD_BufferSize or the
- * size stored in the packed data block.
- *
- * PD_MemoryFlags - Sets MemoryFlags for allocating
- *
- *
- * RESULT
- *
- * EXAMPLE
- * PD_UnpackData(pd,
- * PD_Version, &dataversion, // store version number
- * PD_BYTE, &byte1,
- * PD_BYTE, 0, // byte not stored.
- * PD_STRPTR, &string,
- *
- * PD_IfVersion, 1, /* the following will only be read id PD_Version >= 1 */
- * PD_APTRSize, 10,
- * PD_APTR, &memchunk1,
- * PD_APTR, &memchunk2,
- *
- * PD_IfVersion, 2, /* the following will only be read id PD_Version >= 2 */
- * PD_STRUCT(mystruct),
- *
- * TAG_DONE, 0))
- *
- * BUGS
- *
- * SEE ALSO
- *
- ******************************************************************************
- *
- */
-